#e
#Title[s\uiv@ցv]
#Text[]
#ScriptVersion[2]

script_enemy_main
{//Enemy01
	let count=0;
	let cx=GetCenterX();//STGV[̒SxW擾
	let cy=GetCenterY();//STGV[̒SyW擾
	let imgExRumia=GetCurrentScriptDirectory~"img\ExRumia.png";
	let imgback=GetCurrentScriptDirectory~"img\RyuukaBack.png";
	let angle=0;
	LoadUserShotData(GetCurrentScriptDirectory~"shot.txt");
	@Initialize
	{
		SetScore(30000);
		SetLife(500);
		SetDamageRate(10,5);
		SetTimer(90);
	
		SetGraphicRect(1,1,64,64);
		SetInvincibility(600);
		
		LoadGraphic(imgExRumia);	
		LoadGraphic(imgback);

		SetMovePosition02(cx,cy-120,60);
		Concentration01(150);
		CutIn(YOUMU,"s\uiv@ցv",0,0,0,0,0);
	}
	@MainLoop
	{
		let s=0;
		let base =GetAngleToPlayer;

		SetCollisionA(GetX(),GetY(),24);
		SetCollisionB(GetX(),GetY(),24);
		SetShotAutoDeleteClip(512,512,512,512);

		if(count>=1)
		{
			if(count==240)
			{
			CreateShotA(s,GetX,GetY,0);	
			SetShotDataA(s,0,1,90,0,0,3,41);
			FireShot(s);
			}
			if(count%360==0)
			{
				loop(240)
				{
					let c=rand_int(0,1);
					let color=rand_int(41,42);
					let speed=rand(0.5,3);
					SetShotDirectionType(SEQUENCE);
					CreateShotA(s,cx,cy,0);	
					SetShotDataA(s,0,speed,rand(0,360),0,0,3,color);
					if(c==1)
					{
						
						SetShotDataA(s,120,speed/2,0,0,0,3,color);
						SetShotDataA(s,180,speed,180,0,0,3,color);
						SetShotDataA(s,330,0,0,0,0,3,color);
						SetShotKillTime(s,360);
					}
					FireShot(s);
				}
			}
		}
	count++;

	}
	@Finalize
	{//ǂ݂񂾃t@C폜

	}
	@DrawLoop
	{
		if(count<270){SetGraphicRect(64,64,127,127)};
		if(count>=270){SetGraphicRect(1,1,64,64);}
		SetAlpha(255);
		SetTexture(imgExRumia);
		DrawGraphic(GetX(),GetY());
	}
}